<div style="padding:5px;border:1px solid #ddd">
    <a id="{$Think.CONTROLLER_NAME}_{$Think.ACTION_NAME}_close" href="#" class="easyui-linkbutton"
       data-options="iconCls:'icon-close'">{:lang('关闭')}</a>
    <!-- 表格表头按钮组 js创建 -->

    <a id="{$Think.CONTROLLER_NAME}_{$Think.ACTION_NAME}_ref" href="#" class="easyui-linkbutton"
       data-options="iconCls:'icon-ref'">{:lang('刷新')}</a>
    <!-- 如果没有定义功能下拉菜单，会导致easyui 解析失败报错 -->
    <a href="#" class="easyui-menubutton"
       data-options="menu:'#{$Think.CONTROLLER_NAME}_{$Think.ACTION_NAME}_popup_menu',iconCls:'icon-function'">{:lang('功能')}</a>
</div>
<script language="javascript">
    $(document).ready(function () {
        console.log('-- common/view/widget/pc/easyui/buttons.html');

        var index = new Page({
            Module: '{$Think.MODULE_NAME}',
            Controller: '{$Think.CONTROLLER_NAME}',
            Action: '{$Think.ACTION_NAME}',
        });


        // 窗口定义
        var url = "{:url('record')}";
        url = index.url().add_param(url);

        index.menubutton().linkbutton_init(index.data.Top_Buttons, 'close', 'after');
        index.menubutton().linkbutton_event(index.data.Top_Buttons, 'index', {
            add: {
                win_op: {
                    href: url,
                    fit: true,
                    title: "{$data['Win_Record']['title']}",
                    draggable: false,
                    toolbar: '#{$Think.CONTROLLER_NAME}_record_toolbar',
                    onOpen: function () {
                        index.child_record.auto_run().when_build_ele_finish();
                    }
                },
            },
            edit: {
                grid_id: 'MG',
                win_op: {
                    href: url,
                    fit: true,
                    title: "{$data['Win_Record']['title']}",
                    draggable: false,
                    toolbar: '#{$Think.CONTROLLER_NAME}_record_toolbar',
                    onOpen: function () {
                        index.child_record.auto_run().when_build_ele_finish();
                    }
                },
            }
        });
        // todo::初始化按钮点击时的动作

        index.gui_build_state.TopButtons = true;
    });
</script>

